<?php

namespace App\Module;
use GuzzleHttp\Client;

class SendCMD extends BaseModule
{
    private $client = null;

    public function __construct()
    {
        $this->client = new Client();
    }

    /**
     * 踢出玩家
     * @var $uri 创建工会扩展字段站长自行配置网址例如 http://182.43.51.222:28262/?cmd=
     * @var $steamid 玩家id
     * @var $reason 应该是原因和备注信息例如：清理挂机 处理人:『TiMii』北极星，申诉、投诉渠道：YY:978043（QQ群：682419240）
     */
    public function AdminKick($uri, $steamid, $reason = "")
    {
        $res = $this->client->request("GET", "{$uri}AdminKick {$steamid} {$reason}");
        return $res->getBody()->getContents();
    }

    /**
     * 封禁玩家
     * @var $uri 创建工会扩展字段站长自行配置网址例如 http://182.43.51.222:28262/?cmd=
     * @var $steamid 玩家id
     * @var $days 封禁天数 例如 1d=1天   3d=3天  1m=1个月 
     * @var $reason 应该是原因和备注信息例如：清理挂机 处理人:『TiMii』北极星，申诉、投诉渠道：YY:978043（QQ群：682419240）
     */
    public function AdminBan($uri, $steamid, $days, $reason = "")
    {
        $res = $this->client->request("GET", "{$uri}AdminBan {$steamid} {$days} {$reason}");
        return $res->getBody()->getContents();
    }

    /**
     * 警告玩家
     * @var $uri 创建工会扩展字段站长自行配置网址例如 http://182.43.51.222:28262/?cmd=
     * @var $steamid 玩家id
     * @var $reason 应该是原因和备注信息例如：清理挂机 处理人:『TiMii』北极星，申诉、投诉渠道：YY:978043（QQ群：682419240）
     */
    public function AdminWarn($uri, $steamid, $reason = "")
    {
        $res = $this->client->request("GET", "{$uri}AdminWarn {$steamid} {$reason}");
        return $res->getBody()->getContents();
    }

    /**
     * 强制跳边
     * @var $uri 创建工会扩展字段站长自行配置网址例如 http://182.43.51.222:28262/?cmd=
     * @var $steamid 玩家id
     */
    public function AdminForceTeamChange($uri, $steamid)
    {
        $res = $this->client->request("GET", "{$uri}AdminForceTeamChange {$steamid}");
        return $res->getBody()->getContents();
    }

    /**
     * 解散小队
     * @var $uri 创建工会扩展字段站长自行配置网址例如 http://182.43.51.222:28262/?cmd=
     * @var $groupid 阵营id
     * @var $teamid 队伍id
     */
    public function AdminDisbandSquad($uri, $groupid, $teamid)
    {
        $res = $this->client->request("GET", "{$uri}AdminDisbandSquad {$groupid} {$teamid}");
        return $res->getBody()->getContents();
    }

    /**
     * 踢出小队
     * @var $uri 创建工会扩展字段站长自行配置网址例如 http://182.43.51.222:28262/?cmd=
     * @var $steamid 玩家id
     */
    public function AdminRemovePlayerFromSquadById($uri, $steamid)
    {
        $res = $this->client->request("GET", "{$uri}AdminRemovePlayerFromSquadById {$steamid}");
        return $res->getBody()->getContents();
    }

    /**
     * 解除与锁定玩家装备限制
     * @var $uri 创建工会扩展字段站长自行配置网址例如 http://182.43.51.222:28262/?cmd=
     * @var $mark 0-锁定玩家装备限制   1-解除玩家装备限制
     */
    public function AdminForceAllRoleAvailability($uri, $mark)
    {
        $res = $this->client->request("GET", "{$uri}AdminForceAllRoleAvailability {$mark}");
        return $res->getBody()->getContents();
    }

    /**
     * 解除与锁定载具认证限制
     * @var $uri 创建工会扩展字段站长自行配置网址例如 http://182.43.51.222:28262/?cmd=
     * @var $mark 0-锁定载具认证限制   1-解除载具认证限制
     */
    public function AdminDisableVehicleClaiming($uri, $mark)
    {
        $res = $this->client->request("GET", "{$uri}AdminDisableVehicleClaiming {$mark}");
        return $res->getBody()->getContents();
    }

    /**
     * 预设地图与更改地图
     * @var $uri 创建工会扩展字段站长自行配置网址例如 http://182.43.51.222:28262/?cmd=
     * @var $handle  AdminChangeLayer-预设地图   AdminSetNextLayer-更改地图
     */
    public function MapSet($uri, $handle)
    {
        $res = $this->client->request("GET", "{$uri}{$handle} Yehorivka_Skirmish_v3");
        return $res->getBody()->getContents();
    }
}

